import axios from 'axios';
import {  req } from './axiosfun';
// 获取角色
export const getRoleInfo=(id)=>{
    return req("get",`/api/Role/${id}`)
}
// 角色列表
export const getRoleList=(params)=>{
    return req("post","/api/Role",params)
};
// 新增角色
export const Create=(params)=>{
    // console.log(params);
    return req("post","/api/Role/Create",params)
}
// 修改角色
export const Update=(params)=>{
    return req("put","/api/Role/Update?id="+params.id,params)
}
// 删除角色
export const Delete=(params)=>{
    return req("delete","/api/Role/Delete?id="+params)
}
// 获取左侧用户数据
export const getLeftList=(params)=>{
    return req("get","/api/Role/GetLeftList?RoleId="+params)
}


// 获取右侧角色已拥有用户
export const getRightList=(params)=>{
    return req("get","/api/Role/GetRightList?RoleId="+params)
}
//数据提交
export const submitUserRole=(id,params)=>{
    return req("post","/api/Role/SubmitRoleUser?RoleId="+id,params)
}
//角色菜单提交
export const submitPerssion=(roleId,params)=>{
    return req("post","/api/Role/SubmitPerssion?RoleId="+roleId,params)
}
export default {
    getRoleInfo,
    getRoleList,
    Create,
    Update,
    Delete,
    getLeftList,
    getRightList,
    submitPerssion
};